package com.mimc.framework.utils;

import com.jfinal.aop.Aop;
import com.mimc.framework.jwt.ApiTokenUtils;
import com.mimc.service.ShTranslateService;

public class TranslateUtil {
    public static String translate(String key){
        ShTranslateService shTranslateService= Aop.get(ShTranslateService.class);
        String lang= ApiTokenUtils.getLang();
        if(lang==null){
            lang=shTranslateService.getDefaultLang();
        }

        return shTranslateService.translate(key,lang);
    }
}
